package executor;

/**
 * @author tongchen
 * @create 2023-01-25 10:22
 */
public class TestMyThreadPool1 {
    public static void main(String[] args) throws InterruptedException {
        MyThreadPool myThreadPool = new MyThreadPool(3);
        for (int i = 0; i <100 ; i++) {
            int task=i;
            myThreadPool.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println("任务"+task+"线程"+Thread.currentThread());
                }
            });
        }
    }
}
